package com.team7.controller;

import com.team7.service.CourseCheckService;
import com.team7.vo.CommonResult;
import com.team7.vo.CourseCheckVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * @program: team7-object
 * @description:
 * @author: 田宏洋
 * @create: 2021-10-20 16:00
 **/

@RestController
@RequestMapping("/core/courseCheck")
public class CourseCheckController {
    @Resource
    private CourseCheckService checkCourseService;
    @PostMapping("/findCourseCheck/{page}/{limit}")
    @ApiOperation("分页查询课程审核的接口")
    public CommonResult findCourseCheck(@PathVariable("page") Integer page, @PathVariable("limit") Integer limit, @RequestBody CourseCheckVo courseCheckVo){
        CommonResult commonResult = checkCourseService.findCourseCheckWithWait(page, limit, courseCheckVo);
        return commonResult;
    }
    @PostMapping("/updateCourseCheck")
    @ApiOperation("审核课程的方法")
    public CommonResult updateCourseCheck(@RequestBody CourseCheckVo courseCheckVo){
        LocalDateTime now = LocalDateTime.now();
        String s = now.toString();
        courseCheckVo.setCheckTime(s);
        CommonResult commonResult = checkCourseService.updateCourseCheck(courseCheckVo);
        return commonResult;
    }
}
